﻿using System;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["login"] != null)
            Response.Redirect("~/Admin/picturemanagement.aspx");
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        if (tbUserName.Text != "niyi2002" || tbPassword.Text != "niyi2002")
        {
            AlertHelper.AlertErrorMsg("loginfailed", "用户名或密码错误");
        }
        else
        {
            Session["login"] = true;
            string returnUrl = Request.QueryString["returnurl"];
            if (returnUrl != null)
                Response.Redirect(returnUrl);
            else
                Response.Redirect("~/Admin/picturemanagement.aspx");
        }
    }
}
